package com.ht.medicaltreatment.bean

import android.os.Parcel
import android.os.Parcelable

data class WanDaiBean(
    val drawBloodMoreOrder: DrawBloodMoreOrder?,
    val drawbloodList: List<Drawblood>,
    val isAllCheckFinish: Boolean,
    val patientInformation: PatientInformationX
)

data class DrawBloodMoreOrder(
    val bloodCount: Int,
    val bloodNum: Int,
    val checkSuccess: Int,//0是未核验,1是已核验,2是核验中
    val drugTime: String,
    val id: Int,
    val inputTime: String,
    val inputuserId: Int,
    val inputuserName: String,
    val isBloodOrder: Int,
    val isMore: Int,
    val name: String,
    val orderDelState: Int,
    val patientId: String,
    val project: Any,
    val reason: Any,
    val signature: Any,
    val singleOrManyTimes: Int,
    val twoDrugStatus: Int,
    val twoDrugTime: Any,
    val twoDrugTimeStamp: Any
)

data class Drawblood(
    val actualCapacity: String?,
    var actualTime: String?,
    val afterTimeStamp: String?,
    val barCode: String?,
    //val bloodCollectionDevice: Any,
    val bloodCount: Int,
    val bloodGroupSum: Int,
    val bloodgroup: Int,
    val capacity: String?,
    var checkSuccess: Int,//0:未核验,1:核验正常（核验完了，并且采完血了） 2:超窗 3:紧急跳过  4 采血(自己添加的)
    //val collectBloodPart: Any,
    //val color: Any,
   // val color2: Any,
    val dbDelState: Int,
    val drawbloodMoreOrder: DrawbloodMoreOrderX?,
    val expectTime: String?,
    val id: Int,
    val isBlood: Int,
    val isDrug: Int,
    val isMore: Int,
    val name: String?,
    val opertionPersonName: String?,
    val otherRemark: String?,
    val patientInformation: PatientInformation?,
    //val postponeTime: Any,
    val preTimeStamp: String?,
    var rfidCode: String?,
    val rfidSampleId: Int,
    var scanTime: String?,
    var time: String?,
   // val times: Any,
   // val urineVolume: Any,
    val ward: WardX?,
    var isChecked:Boolean
) : Parcelable {
    constructor(parcel: Parcel) : this(
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readInt(),
        parcel.readInt(),
        parcel.readInt(),
        parcel.readString(),
        parcel.readInt(),
        parcel.readInt(),
        parcel.readParcelable(DrawbloodMoreOrderX::class.java.classLoader),
        parcel.readString(),
        parcel.readInt(),
        parcel.readInt(),
        parcel.readInt(),
        parcel.readInt(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readParcelable(PatientInformation::class.java.classLoader),
        parcel.readString(),
        parcel.readString(),
        parcel.readInt(),
        parcel.readString(),
        parcel.readString(),
        parcel.readParcelable(WardX::class.java.classLoader),
        parcel.readByte() != 0.toByte()
    ) {
    }

    override fun writeToParcel(parcel: Parcel, flags: Int) {
        parcel.writeString(actualCapacity)
        parcel.writeString(actualTime)
        parcel.writeString(afterTimeStamp)
        parcel.writeString(barCode)
        parcel.writeInt(bloodCount)
        parcel.writeInt(bloodGroupSum)
        parcel.writeInt(bloodgroup)
        parcel.writeString(capacity)
        parcel.writeInt(checkSuccess)
        parcel.writeInt(dbDelState)
        parcel.writeParcelable(drawbloodMoreOrder, flags)
        parcel.writeString(expectTime)
        parcel.writeInt(id)
        parcel.writeInt(isBlood)
        parcel.writeInt(isDrug)
        parcel.writeInt(isMore)
        parcel.writeString(name)
        parcel.writeString(opertionPersonName)
        parcel.writeString(otherRemark)
        parcel.writeParcelable(patientInformation, flags)
        parcel.writeString(preTimeStamp)
        parcel.writeString(rfidCode)
        parcel.writeInt(rfidSampleId)
        parcel.writeString(scanTime)
        parcel.writeString(time)
        parcel.writeParcelable(ward, flags)
        parcel.writeByte(if (isChecked) 1 else 0)
    }

    override fun describeContents(): Int {
        return 0
    }

    companion object CREATOR : Parcelable.Creator<Drawblood> {
        override fun createFromParcel(parcel: Parcel): Drawblood {
            return Drawblood(parcel)
        }

        override fun newArray(size: Int): Array<Drawblood?> {
            return arrayOfNulls(size)
        }
    }
}

data class PatientInformationX(
    //val animalGroup: Any,
   // val drawBloodList: Any,
    val id: Int,
    //val orderIdList: Any,
    val patientCode: String,
    val patientIdCard: String,
    val patientName: String,
    val patientNamecode: String,
    val patientSex: String,
    //val project: ProjectX,
    //val reason: Any,
    val rfidCode: String,
    //val signature: Any,
    val urineRfidCode: String,
    val ward: WardXX,
    val warningTime: Int
)

data class DrawbloodMoreOrderX(
    val bloodCount: Int,
    val bloodNum: Int,
    val checkSuccess: Int,
    val drugTime: String?,
    val id: Int,
    val inputTime: String?,
    val inputuserId: Int,
    val inputuserName: String?,
    val isBloodOrder: Int,
    val isMore: Int,
    val name: String?,
    val orderDelState: Int,
    val patientId: String?,
    //val project: Any,
    //val reason: Any,
    //val signature: Any,
    val singleOrManyTimes: Int,
    val twoDrugStatus: Int,
    //val twoDrugTime: Any,
    //val twoDrugTimeStamp: Any
) : Parcelable {
    constructor(parcel: Parcel) : this(
        parcel.readInt(),
        parcel.readInt(),
        parcel.readInt(),
        parcel.readString(),
        parcel.readInt(),
        parcel.readString(),
        parcel.readInt(),
        parcel.readString(),
        parcel.readInt(),
        parcel.readInt(),
        parcel.readString(),
        parcel.readInt(),
        parcel.readString(),
        parcel.readInt(),
        parcel.readInt()
    ) {
    }

    override fun writeToParcel(parcel: Parcel, flags: Int) {
        parcel.writeInt(bloodCount)
        parcel.writeInt(bloodNum)
        parcel.writeInt(checkSuccess)
        parcel.writeString(drugTime)
        parcel.writeInt(id)
        parcel.writeString(inputTime)
        parcel.writeInt(inputuserId)
        parcel.writeString(inputuserName)
        parcel.writeInt(isBloodOrder)
        parcel.writeInt(isMore)
        parcel.writeString(name)
        parcel.writeInt(orderDelState)
        parcel.writeString(patientId)
        parcel.writeInt(singleOrManyTimes)
        parcel.writeInt(twoDrugStatus)
    }

    override fun describeContents(): Int {
        return 0
    }

    companion object CREATOR : Parcelable.Creator<DrawbloodMoreOrderX> {
        override fun createFromParcel(parcel: Parcel): DrawbloodMoreOrderX {
            return DrawbloodMoreOrderX(parcel)
        }

        override fun newArray(size: Int): Array<DrawbloodMoreOrderX?> {
            return arrayOfNulls(size)
        }
    }
}

data class PatientInformation(
    //val animalGroup: Any,
    //val drawBloodList: Any,
    val id: Int,
    //val orderIdList: Any,
    val patientCode: String?,
    val patientIdCard: String?,
    val patientName: String?,
    val patientNamecode: String?,
    val patientSex: String?,
    //val project: Project1,
   // val reason: Any,
    val rfidCode: String?,
   // val signature: Any,
    val urineRfidCode: String?,
    //val ward: Ward,
    val warningTime: Int
) : Parcelable {
    constructor(parcel: Parcel) : this(
        parcel.readInt(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readInt()
    ) {
    }

    override fun writeToParcel(parcel: Parcel, flags: Int) {
        parcel.writeInt(id)
        parcel.writeString(patientCode)
        parcel.writeString(patientIdCard)
        parcel.writeString(patientName)
        parcel.writeString(patientNamecode)
        parcel.writeString(patientSex)
        parcel.writeString(rfidCode)
        parcel.writeString(urineRfidCode)
        parcel.writeInt(warningTime)
    }

    override fun describeContents(): Int {
        return 0
    }

    companion object CREATOR : Parcelable.Creator<PatientInformation> {
        override fun createFromParcel(parcel: Parcel): PatientInformation {
            return PatientInformation(parcel)
        }

        override fun newArray(size: Int): Array<PatientInformation?> {
            return arrayOfNulls(size)
        }
    }
}

data class WardX(
    val createTime: String?,
    val id: Int,
    //val location: Any,
    val name: String?,
   // val reason: Any,
   // val remarks: Any,
   // val signature: Any,
   // val user: Any,
    val userId: Int
) : Parcelable {
    constructor(parcel: Parcel) : this(
        parcel.readString(),
        parcel.readInt(),
        parcel.readString(),
        parcel.readInt()
    ) {
    }

    override fun writeToParcel(parcel: Parcel, flags: Int) {
        parcel.writeString(createTime)
        parcel.writeInt(id)
        parcel.writeString(name)
        parcel.writeInt(userId)
    }

    override fun describeContents(): Int {
        return 0
    }

    companion object CREATOR : Parcelable.Creator<WardX> {
        override fun createFromParcel(parcel: Parcel): WardX {
            return WardX(parcel)
        }

        override fun newArray(size: Int): Array<WardX?> {
            return arrayOfNulls(size)
        }
    }
}

data class Project1(
    val alarmFrontData: Any,
    val analyzeUnit: String,
    val backupBranchPacked: String,
    val bloodBeforeCondition: Any,
    val bloodCollectionDeviceId: Int,
    val bloodCondition: Any,
    val bloodPartId: Int,
    val bloodSamplingAlarmDate: Any,
    val bloodTimeRangeConstraint: Any,
    val centrifugalAccTime: Any,
    val centrifugalDownTime: Any,
    val centrifugalPlace: Any,
    val centrifugalSpeed: Any,
    val centrifugalTemperature: Any,
    val centrifugalTime: Any,
    val clinicalTestBatchNumber: String,
    val croUnit: String,
    val currentDayIsOrMoreDrug: Int,
    val deliveryCondition: Any,
    val detectionBranchPacked: String,
    val drawBloodPlace: Any,
    val drugName: String,
    val goTheRefrigeratorAgoDate: Any,
    val goTheRefrigeratorAlarmDate: Any,
    val id: Int,
    val inputCentrifugeTimeStatus: Int,
    val inputRefrigeratorTimeStatus: Int,
    val isOrAuditPerson: Int,
    val isOrBloodRecord: Int,
    val isOrNotDrawBloodOperatorSignature: Int,
    val isOrNotStabilizingSolutionTime: Int,
    val isOrNotStandingTime: Int,
    val isOrPrintTime: Int,
    val isOrReviewer: Int,
    val lockSign: Int,
    val maxStandingTime: Any,
    val micropipetteNoId: Int,
    val minStandingTime: Any,
    val name: String,
    val notifyTime: Int,
    val projectNumber: String,
    val protocolNumber: String,
    val reason: Any,
    val receiveCity: String,
    val receiveDetailedAddress: Any,
    val receivePerson: Any,
    val receivePersonContact: Any,
    val receiveProvince: String,
    val researchUnit: String,
    val responsiblePerson: String,
    val severalSeriesUnit: String,
    val signature: Any,
    val singleOrManyTimes: Int,
    val sponsor: String,
    val standingTimeStatus: String,
    val subjectAnalysisPrincipal: Any,
    val subpackageCondition: Any,
    val subpackagePlace: Any,
    val subpackagingRequirement: Any
)

data class Ward(
    val createTime: String,
    val id: Int,
    val location: Any,
    val name: String,
    val reason: Any,
    val remarks: Any,
    val signature: Any,
    val user: Any,
    val userId: Int
)

data class ProjectX(
    val alarmFrontData: Any,
    val analyzeUnit: String,
    val backupBranchPacked: String,
    val bloodBeforeCondition: Any,
    val bloodCollectionDeviceId: Int,
    val bloodCondition: Any,
    val bloodPartId: Int,
    val bloodSamplingAlarmDate: Any,
    val bloodTimeRangeConstraint: Any,
    val centrifugalAccTime: Any,
    val centrifugalDownTime: Any,
    val centrifugalPlace: Any,
    val centrifugalSpeed: Any,
    val centrifugalTemperature: Any,
    val centrifugalTime: Any,
    val clinicalTestBatchNumber: String,
    val croUnit: String,
    val currentDayIsOrMoreDrug: Int,
    val deliveryCondition: Any,
    val detectionBranchPacked: String,
    val drawBloodPlace: Any,
    val drugName: String,
    val goTheRefrigeratorAgoDate: Any,
    val goTheRefrigeratorAlarmDate: Any,
    val id: Int,
    val inputCentrifugeTimeStatus: Int,
    val inputRefrigeratorTimeStatus: Int,
    val isOrAuditPerson: Int,
    val isOrBloodRecord: Int,
    val isOrNotDrawBloodOperatorSignature: Int,
    val isOrNotStabilizingSolutionTime: Int,
    val isOrNotStandingTime: Int,
    val isOrPrintTime: Int,
    val isOrReviewer: Int,
    val lockSign: Int,
    val maxStandingTime: Any,
    val micropipetteNoId: Int,
    val minStandingTime: Any,
    val name: String,
    val notifyTime: Int,
    val projectNumber: String,
    val protocolNumber: String,
    val reason: Any,
    val receiveCity: String,
    val receiveDetailedAddress: Any,
    val receivePerson: Any,
    val receivePersonContact: Any,
    val receiveProvince: String,
    val researchUnit: String,
    val responsiblePerson: String,
    val severalSeriesUnit: String,
    val signature: Any,
    val singleOrManyTimes: Int,
    val sponsor: String,
    val standingTimeStatus: String,
    val subjectAnalysisPrincipal: Any,
    val subpackageCondition: Any,
    val subpackagePlace: Any,
    val subpackagingRequirement: Any
)

data class WardXX(
    val createTime: String,
    val id: Int,
    val location: Any,
    val name: String,
    val reason: Any,
    val remarks: String,
    val signature: Any,
    val user: Any,
    val userId: Int
)